import request from '@/utils/request'

import { jdyadmin } from '@/settings'
/**
 * -------------------------------------------------------
 * -------------------------随手拍-------------------------
 * -------------------------------------------------------
 */
// 查询
export function getSuiShou(data) {
  return request({
    url: `${jdyadmin}/jdySsp/seletejdySsp`,
    method: `post`,
    data
  })
}

// 增加
export function addSuiShou(data) {
  return request({
    url: `${jdyadmin}/jdySsp/addjdySsp`,
    method: `post`,
    data
  })
}

// 修改
export function updateSuiShou(data) {
  return request({
    url: `${jdyadmin}/jdySsp/updatejdySsp`,
    method: `post`,
    data
  })
}

// 修改
export function deleteSuiShou(id) {
  return request({
    url: `${jdyadmin}/jdySsp/deletejdyRole/${id}`,
    method: `DELETE`
  })
}
/**
 * -------------------------------------------------------
 * -------------------------意见箱-------------------------
 * -------------------------------------------------------
 */
// 查询
export function getIdea(data) {
  return request({
    url: `${jdyadmin}/departmentSuggest/seleteUserPermission`,
    method: `post`,
    data
  })
}

// 增加
export function addIdea(data) {
  return request({
    url: `${jdyadmin}/departmentSuggest/addUserPermission`,
    method: `post`,
    data
  })
}

// 修改
export function updateIdea(data) {
  return request({
    url: `${jdyadmin}/departmentSuggest/updateUserPermission`,
    method: `post`,
    data
  })
}

// 删除
export function deleteIdea(id) {
  return request({
    url: `${jdyadmin}/departmentSuggest/deleteUserPermission/${id}`,
    method: `DELETE`
  })
}

/**
 * -------------------------------------------------------
 * -------------------------职教室-------------------------
 * -------------------------------------------------------
 */
// 查询
export function getClassroom(data) {
  return request({
    url: `${jdyadmin}/jdyClassroom/seletejdyClassroom`,
    method: `post`,
    data
  })
}

// 增加
export function addClassroom(data) {
  return request({
    url: `${jdyadmin}/jdyClassroom/addjdyClassroom`,
    method: `post`,
    data
  })
}

// 修改
export function updateClassroom(data) {
  return request({
    url: `${jdyadmin}/jdyClassroom/updatejdyClassroom`,
    method: `post`,
    data
  })
}

// 删除
export function deleteClassroom(id) {
  return request({
    url: `${jdyadmin}/jdyClassroom/deletejdyClassroom/${id}`,
    method: `DELETE`
  })
}

/**
 * -------------------------------------------------------
 * ----------------------小程序商品-----------------------
 * -------------------------------------------------------
 */
// 查询
export function getXcxPro(data) {
  return request({
    url: `${jdyadmin}/jdyCommodityApplet/seleteJdyCommodityApplet`,
    method: `post`,
    data
  })
}

// 增加
export function addXcxPro(data) {
  return request({
    url: `${jdyadmin}/jdyCommodityApplet/addJdyCommodityApplet`,
    method: `post`,
    data
  })
}

// 修改
export function updateXcxPro(data) {
  return request({
    url: `${jdyadmin}/jdyCommodityApplet/updateJdyCommodityApplet`,
    method: `post`,
    data
  })
}

// 删除
export function deleteXcxPro(id) {
  return request({
    url: `${jdyadmin}/jdyCommodityApplet/deleteJdyCommodityApplet/${id}`,
    method: `DELETE`
  })
}


/**
 * -------------------------------------------------
 * ------------------食品安全管理--------------------
 * -------------------------------------------------
 */
// 分类列表
export function getAnquanMulu(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodSafety/seletekeyPoJdyAppletFoodSafety`,
    method: `post`,
    data
  })
}

// 新增分类
export function addAnquanMulu(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodSafety/addkeyPoJdyAppletFoodSafety`,
    method: `post`,
    data
  })
}

// 更新分类
export function updateAnquanMulu(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodSafety/updatekeyPoJdyAppletFoodSafety`,
    method: `post`,
    data
  })
}

// 删除分类
export function deleteAnquanMulu(id) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodSafety/deletekeyPoJdyAppletFoodSafety/${id}`,
    method: `delete`
  })
}

/**
 * -------------------------------------------------
 * -------------------食品安全管理-------------------
 * -------------------------------------------------
 */
// 新增食品安全问题
export function addProblem(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodSafetyProblems/addjdyAppletFoodSafetyProblems`,
    method: `post`,
    data
  })
}

// 查询食品安全问题
export function selectProblem(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodSafetyProblems/seletejdyAppletFoodSafetyProblems`,
    method: `post`,
    data
  })
}

// 更新食品安全问题
export function updateProblem(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodSafetyProblems/updatejdyAppletFoodSafetyProblems`,
    method: `post`,
    data
  })
}

// 删除食品安全问题
export function deleteProblem(id) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodSafetyProblems/deletejdyAppletFoodSafetyProblems/${id}`,
    method: `delete`,
  })
}


/**
 * -------------------------------------------------
 * -------------------食品安全履职-------------------
 * -------------------------------------------------
 */
// 新增食品安全问题处理
export function addProblemResult(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodSafetyProblemsReult/addjdyAppletFoodSafetyProblemsReult`,
    method: `post`,
    data
  })
}

// 查询食品安全问题处理
export function selectProblemResult(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodSafetyProblemsReult/seletejdyAppletFoodSafetyProblemsReult`,
    method: `post`,
    data
  })
}

// 更新食品安全问题处理
export function updateProblemResult(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodSafetyProblemsReult/updatejdyAppletFoodSafetyProblemsReult`,
    method: `post`,
    data
  })
}

// 删除食品安全问题处理
export function deleteProblemResult(id) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodSafetyProblemsReult/deletejdyAppletFoodSafetyProblemsReult/${id}`,
    method: `delete`,
  })
}


/**
 * ----------------------------------------------------
 * -------------------食品安全人员管理------------------
 * ----------------------------------------------------
 */
// 新增食品安全问题处理
export function addRenyuanGuanli(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFootSafetyPerson/addjdyAppletFootSafetyPerson`,
    method: `post`,
    data
  })
}

// 查询食品安全问题处理
export function selectRenyuanGuanli(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFootSafetyPerson/seletejdyAppletFootSafetyPerson`,
    method: `post`,
    data
  })
}

// 更新食品安全问题处理
export function updateRenyuanGuanli(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFootSafetyPerson/updatejdyAppletFootSafetyPerson`,
    method: `post`,
    data
  })
}

// 删除食品安全问题处理
export function deleteRenyuanGuanli(id) {
  return request({
    url: `${jdyadmin}/jdyAppletFootSafetyPerson/deletejdyAppletFootSafetyPerson/${id}`,
    method: `delete`,
  })
}

// 获取所有车间
export function getAllchejian(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodSafety/seleteAllChejianDrtment/`,
    method: `post`,
    data
  })
}

// 获取公司级监管
export function getAllgongsi(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodSafety/seleteAllPoJdyAppletFoodSafety`,
    method: `post`,
    data
  })
}

/**
 * 人员权限分类管理
 * @param data 
 */
// 新增人员权限管理
export function addQuanxian(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodZhicheng/addjdyAppletFoodSafetyProblemsReult`,
    method: `post`,
    data
  })
}
// 修改人员权限管理
export function updateQuanxian(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodZhicheng/updatejdyAppletFoodSafetyProblemsReult`,
    method: `post`,
    data
  })
}
// 获取人员权限
export function getQuanxian(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodZhicheng/seletejdyAppletFoodSafetyProblemsReult`,
    method: `post`,
    data
  })
}
// 删除人员权限
export function deleteQuanxian(id) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodZhicheng/deletejdyAppletFoodSafetyProblemsReult/${id}`,
    method: `delete`
  })
}


/**
 * 总监管理
 * @param data 
 */
// 新增总监
export function addAllzongjian(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodSafetyMajordomo/addMajordomo`,
    method: `post`,
    data
  })
}
// 修改总监
export function updateAllzongjian(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodSafetyMajordomo/updateMajordomo`,
    method: `post`,
    data
  })
}
// 获取所有总监
export function getAllzongjian(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodSafetyMajordomo/seleteMajordomo`,
    method: `post`,
    data
  })
}
// 删除总监
export function deleteAllzongjian(id) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodSafetyMajordomo/deletekeyPoJdyAppletFoodSafety/${id}`,
    method: `delete`
  })
}

/**
 * 问题分类
 */
// 新增问题分类
export function addProblemClassify(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodClassify/addjdyAppletFoodSafetyProblemsReult`,
    method: `post`,
    data
  })
}
// 修改问题分类
export function updateProblemClassify(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodClassify/updatejdyAppletFoodSafetyProblemsReult`,
    method: `post`,
    data
  })
}
// 获取问题分类
export function getProblemClassify(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodClassify/seletejdyAppletFoodSafetyProblemsReult`,
    method: `post`,
    data
  })
}
// 删除问题分类
export function deleteProblemClassify(id) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodClassify/deletejdyAppletFoodSafetyProblemsReult/${id}`,
    method: `delete`
  })
}

/**
 * 导出管理
 */
// 公司提交问题导出
export function exportGongsi(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodSafetyProblemsReult/debgognsiExcle`,
    method: `post`,
    responseType: `arraybuffer`,
    data
  })
}

// 车间提交问题导出
export function exportChejian(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodSafetyProblemsReult/debtchejianExcle`,
    method: `post`,
    responseType: `arraybuffer`,
    data
  })
}

// 班组提交问题导出
export function exportBanzu(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodSafetyProblemsReult/debtbanzhuExcle`,
    method: `post`,
    responseType: `arraybuffer`,
    data
  })
}

// 班组需要处理得问题导出
export function exportBanzuChuli(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodSafetyProblemsReult/debtbanzhuchuliExcle`,
    method: `post`,
    responseType: `arraybuffer`,
    data
  })
}

// 外部给车间提出问题导出
export function exportForchejian(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodSafetyProblemsReult/debtwaibuchejianExcle`,
    method: `post`,
    responseType: `arraybuffer`,
    data
  })
}

// 总监车间提出问题导出
export function exportZongjian(data) {
  return request({
    url: `${jdyadmin}/jdyAppletFoodSafetyProblemsReult/debzongjianExcle`,
    method: `post`,
    responseType: `arraybuffer`,
    data
  })
}